<?php 
class Widgets extends E_Entity 
{
	public   $table =array(
					"id" =>"id",
					"version"=>"version",
					"name" =>"name",  
					"shortname" =>"shortname", 
					"descript" =>"descript",
					"tplshow" =>"tplshow",  
					"tplsetting" =>"tplsetting",
					"sign" =>"sign",
					"status" =>"status",
					"ctime" =>"ctime",
					"mtime" =>"mtime"
					);
					
	public function getTableName()
	{
		return "micro_widget";
	}
	public static function insertEntity($row)
	{	
		$entity = new self();
	 	return $entity->createEntityForRow($row);
	}
	public static function getById($id)
	{
		$entity = new self();
		$sql =  "select * from {$entity->getTableName()} where  {$entity->table['id']} = :id";
		return $entity->getEntityByIndexKey($sql, $id, array("id"=>$id));
	}
	public static function getList()
	{
		$entity = new self();
		$sql =  "select * from {$entity->getTableName()} ";
		return $entity->birthEntity($sql);
	}
}
?>